package org.ladybug.service.impl;

import org.junit.Test;
import org.ladybug.service.CommandService;
import org.ladybug.web.controller.model.ModelApplicativo;
import org.ladybug.web.controller.model.ModelProfile;
import org.ladybug.web.controller.model.ModelRuolo;
import org.ladybug.web.controller.model.ModelUtente;

import test.AbstractLadybugTest;

public class CreaProfiloUtenteCommandServiceTest extends AbstractLadybugTest{

	CommandService creaProfiloUtenteService;
	
	
	public CreaProfiloUtenteCommandServiceTest() {
		super();
		setAutowireMode(this.AUTOWIRE_BY_NAME);
	// TODO Auto-generated constructor stub
	}
	public CreaProfiloUtenteCommandServiceTest(String name) {
		super(name);
		setAutowireMode(this.AUTOWIRE_BY_NAME);
		// TODO Auto-generated constructor stub
	}
	@Test
	public void testInsertOrUpdate() throws Exception {
		ModelProfile joinCommand = new ModelProfile();
		ModelApplicativo appCommand = new ModelApplicativo();
		appCommand.setIdApplicativo("1");
		joinCommand.setApplicativo(appCommand);
		ModelRuolo ruolo=new ModelRuolo();
		ruolo.setIdRuolo("13");
		ModelUtente utente = new ModelUtente();
		utente.setNickname("edoardo");
		joinCommand.setRuolo(ruolo);
		joinCommand.setUtente(utente);
		creaProfiloUtenteService.insertOrUpdate(joinCommand, null);
	}
	public CommandService getCreaProfiloUtenteService() {
		return creaProfiloUtenteService;
	}
	public void setCreaProfiloUtenteService(CommandService joinCommandService) {
		this.creaProfiloUtenteService = joinCommandService;
	}

}
